package com.motherchild.user.controller;

import com.motherchild.common.ApiResponse;
import com.motherchild.user.dto.UserOrderDTO;
import com.motherchild.user.service.UserOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/userOrder")
public class UserOrderController {
    @Autowired
    private UserOrderService userOrderService;

    @PostMapping("/createOrder/{userId}")
    public ApiResponse<Void> createOrder(@RequestBody UserOrderDTO orderDTO, @PathVariable Long userId) {
        orderDTO.setUserId(userId);
        userOrderService.createOrder(orderDTO); // 创建订单
        return ApiResponse.success(); // 返回成功响应
    }

    // 其他方法...
}